<?php
include("../includes/conn.php");
if ($_POST['act'] == 'editsave')
{
	$shippingnumber = $_POST['shippingnumber']?$_POST['shippingnumber']:'';
	$note = $_POST['note']?$_POST['note']:'';
	$should_pay = $_POST['should_pay']?$_POST['should_pay']:'';
	$id = $_POST['id'];
	$set = array();
	if (!empty($shippingnumber))
	{
		$set[] = 'status=4';
		$set[] = 'shippingnumber=\''.$shippingnumber.'\'';
		$set[] = 'shiptime=\''.date("Y-m-d H:i:s").'\'';
	}
	if (!empty($note))
	{
		$set[] = 'note=\''.$note.'\'';
	}
	if (!empty($should_pay))
	{
		$set[] = 'should_pay='.$should_pay;
	}
	$result = mysql_query('update '.DBQIAN.'buylog set '.implode(',', $set).' where id ='.$id.'');
	if ($result)
	{
		echo 'success';
	}
	else
	{
		echo 'update '.DBQIAN.'buylog set '.implode(',', $set).' where id ='.$id.'';
	}
}